function checkUser(){
    var userLenth = $("#user").val().length;
    if(userLenth==0){
        alert("Please enter your account");
        return false;
    }else if(userLenth<4 || userLenth>12){
        alert("4-12");
        return false;
    }
    return true
}

function checkPass(){
    var pwdLenth = $("#pwd1").val().length;
    if(pwdLenth==0){
        alert("Please enter yourpassword");;
        return false;
    }else if(pwdLenth<4){
        alert("It's too easy");
        return false;
    }else if(pwdLenth<4){
        alert("It's too long")
    }
    return true
}
function checkPassSame(){
    var pwd1 = $("#pwd1").val();
    var pwd2 = $("#pwd2").val();
    if(pwd1 != pwd2){
        alert("It not same");
        return false;
    }
    return true
}
function inputClear(){
    $("#user").val("");
    $("#pwd1").val("");
    $("#pwd2").val("");
}
function checkFormInput(){
    if(checkUser() && checkPass() && checkPassSame()){
        return true;
    }else{
        inputClear()
        return false;
    }
}

function eye(id){
    var typeVal = $("#"+id).prop("type");
    if(typeVal == "password"){
        $("#"+id).prop("type","text");
        $("#"+id+"-eye").prop("src","./image/eye_close.jpg");
    }else{
        $("#"+id).prop("type","password");
        $("#"+id+"-eye").prop("src","./image/eye_open.jpg");
   
    }
}